<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Document</title>
	</head>
	<body>
		<script type="text/javascript">
			//使用const声明常量
			//const PI=3.14159;
			//console.log(PI);
			//PI=3;
			//console.log(PI);    //TypeError: Assignment to constant variable.
			
			//使用const命令声明常量初始化
			//const foo;    //SyntaxError: Missing initializer in const declaration
			
			//const声明常量的作用域
			if(true){
				const MAX=5;
			}
			console.log(MAX);     //ReferenceError: MAX is not defined
		</script>
	</body>
</html>